function signInCallback(authResult) {
  console.log(authResult);

  // no error - sign-in success
  if (typeof authResult['error'] == 'undefined') {
    console.log('SIGNED IN');
    // one time code present in response
    if (authResult['code']) {
      console.log('SENDING CODE');
      $('.signinButton').attr('style', 'display: none');
      $.ajax({
        type : 'POST',
        url : '/gapi/postauth/' + $('meta[name=local-nonce]').attr("content"),
        contentType : 'application/octet-stream; charset=utf-8',
        success : function(postAuthResult) {
          // success
          console.log('CODE CONSUMED');
        },
        processData : false,
        data : authResult['code']
      });
    }
  } else {
    // error - not signed-in
    console.log('NOT GRANTING ACCESS');
  }
}